<?php
/**
 * File: fashionista.php.
 * Author: zhouzhe@haibao.com
 * Editor: PhpStorm
 * Date: 16/7/1 下午3:28
 * Brief:
 */
namespace haibao\cms\business;

class Fashionista extends \haibao\cms\business\Base{
	public static function getBloggerList($conditions){
		$data = new \haibao\cms\data\Fashionista();
		return $data->getBloggerList($conditions);
	}

	public static function getBloggerCate(){
		$data = new \haibao\cms\data\Fashionista();
		return $data->getBloggerCate();
	}

	public static function deleteBlogger($uid){
		self::checkOperation(self::FUNC_CODE_FASHIONISTA_BLOGGER_DELETE);
		$data = new \haibao\cms\data\Fashionista();
		$data->deleteBlogger($uid);
		self::saveOperateHistory(self::FUNC_CODE_FASHIONISTA_BLOGGER_DELETE,array($uid));
	}

	public static function editBloggerCate($conditions){
		self::checkOperation(self::FUNC_CODE_FASHIONISTA_CATE_EDIT);
		$data = new \haibao\cms\data\Fashionista();
		$data->editBloggerCate($conditions);
		self::saveOperateHistory(self::FUNC_CODE_FASHIONISTA_CATE_EDIT,$conditions);
	}

	public static function getBloggerCateInfo(){
		$data = new \haibao\cms\data\Fashionista();
		return $data->getBloggerCateInfo();
	}

	public static function getInfoList($conditions){
		$data = new \haibao\cms\data\Fashionista();
		return $data->getInfoList($conditions);
	}

	public static function editBlogTitle($conditions){
		self::checkOperation(self::FUNC_CODE_FASHIONISTA_BLOG_EDIT);
		$data = new \haibao\cms\data\Fashionista();
		$data->editBlogTitle($conditions);
		self::saveOperateHistory(self::FUNC_CODE_FASHIONISTA_BLOG_EDIT,$conditions);
	}

	public static function getPicsByBlogId($blogId){
		$data = new \haibao\cms\data\Fashionista();
		return $data->getPicsByBlogId($blogId);
	}

	public static function setFronPic($blogId,$picId){
		$data = new \haibao\cms\data\Fashionista();
		$data->setFronPic($blogId,$picId);
	}

	public static function deleteBlog($blogId){
		self::checkOperation(self::FUNC_CODE_FASHIONISTA_BLOG_DELETE);
		$data = new \haibao\cms\data\Fashionista();
		$data->deleteBlog($blogId);
		self::saveOperateHistory(self::FUNC_CODE_FASHIONISTA_BLOG_EDIT,$blogId);
	}

	public static function getCateInfoByCateId($cateId){
		$data = new \haibao\cms\data\Fashionista();
		return $data->getCateInfoByCateId($cateId);
	}

	public static function editCate($conditions){
		self::checkOperation(self::FUNC_CODE_FASHIONISTA_CATE_EDIT);
		$data = new \haibao\cms\data\Fashionista();
		$data->editCate($conditions);
		self::saveOperateHistory(self::FUNC_CODE_FASHIONISTA_CATE_EDIT,$conditions);
	}

	public static function delCate($cateId){
		self::checkOperation(self::FUNC_CODE_FASHIONISTA_CATE_DELETE);
		$data = new \haibao\cms\data\Fashionista();
		$data->delCate($cateId);
		self::saveOperateHistory(self::FUNC_CODE_FASHIONISTA_CATE_DELETE,$cateId);
	}

	public static function getBloggerGroupId(){
		return \haibao\cms\data\Fashionista::FASHIONISTA_GROUP_ID;
	}

	public static function getUserByUid($uid){
		$data = new \haibao\cms\data\Fashionista();
		return $data->getUserByUid($uid);
	}

	public static function setUserBlogger($uid){
		$data = new \haibao\cms\data\Fashionista();
		return $data->setUserBlogger($uid);
	}

	public static function addNewBlogPic($imageId,$blogId){
		$data = new \haibao\cms\data\Fashionista();
		$imageInfo = \haibao\cms\business\ImageLibrary::getImageById($imageId);
		if($imageInfo){
			$data->addNewBlogPic($imageInfo,$blogId);
		}
	}

}